import PublicNullData from "@/components/PublicNullData/PublicNullData.vue";
import Public404 from "@/components/Public404/Public404.vue";
import Public500 from "@/components/Public500/Public500.vue";
import PublicHead from "@/components/PublicHead/PublicHead.vue";
let publicPlugins = {
  install: function(Vue, Options) {
    // 添加属性与方法
    //这里我写的$testProp等加了$符号的，表示他为vue全局的，但实际上不加也可以的，访问时也不加就行了
    // Vue.prototype.$myoption = '我是来自插件的属性',
    // Vue.prototype.$myfn = function() {
    // 	console.log('我是来自插件的方法')
    // }
    // 添加全局混入
    Vue.mixin({
      created() {},
      components: {
        PublicNullData,
        Public404,
        Public500,
        PublicHead,
      },
      data() {
        return {
          // 随机数
          random: "",
        };
      },
      computed: {
        mchId() {
          return "";
        },
      },
      mounted() {
        // window.onbeforeunload = function () {
        // 	var storage = window.localStorage;
        // 	storage.clear()
        // }
      },
      methods: {
        // 返回上一层
        goBack() {
          this.$router.go(-1);
        },
      },
    });
    // 添加全局指令
    Vue.directive("dir", {});
  },
};
export default publicPlugins;
